var t = getApp();

Page({
    data: {
        scaleWidth: 355,
        scaleHeight: 320,
        inint: 0,
        imgUrls: [],
        imgAllUrls: [],
        server: t.server,
        serverUrl: t.serverUrl
    },
    onLoad: function(i) {
        var a = this;
        wx.setNavigationBarTitle({
            title: "画册"
        }), console.log(i.id), t.request({
            url: t.server + "/picApi/factoryAlbumInfo",
            method: "POST",
            data: {
                token: t.token,
                id: i.id
            },
            header: {
                "content-type": "application/x-www-form-urlencoded"
            },
            success: function(t) {
                console.log(t.data), a.data.imgAllUrls = t.data.result.album.pic, a.setData({
                    imgUrls: t.data.result.album.pic[a.data.inint]
                });
            }
        });
    },
    onReady: function() {},
    onShow: function() {
        wx.setNavigationBarTitle({
            title: "画册"
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    big: function(t) {
        console.log(this.data.scaleHeight), this.data.scaleHeight <= 720 && this.data.scaleWidth <= 960 && this.setData({
            scaleHeight: this.data.scaleHeight + 120,
            scaleWidth: this.data.scaleWidth + 160
        });
    },
    smoll: function() {
        this.data.scaleHeight > 200 && this.data.scaleWidth > 195 && this.setData({
            scaleHeight: this.data.scaleHeight - 120,
            scaleWidth: this.data.scaleWidth - 160
        });
    },
    toLeft: function() {
        this.data.inint >= 0 && (this.data.inint--, this.setData({
            imgUrls: this.data.imgAllUrls[this.data.inint]
        }));
    },
    toRight: function() {
        console.log(this.data.imgAllUrls), this.data.inint <= this.data.imgAllUrls.length && (this.data.inint++, 
        this.setData({
            imgUrls: this.data.imgAllUrls[this.data.inint]
        }));
    }
});